| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

TabWindow.h
1 // TabWindow.h
3 //
5
6 namespace nkWinUi
7 {
11 class TabWindow : public Component
12 {
13 public :
14
18 class Tab
19 {
20 public :
21
25 Tab (TabWindow* parentWindow) noexcept ;
29 virtual ~Tab () ;
30
31 // Getters
35 nkMemory::StringView getLabel () const ;
39 Window* getAssociatedWin () const ;
43 int getId () const ;
47 TabWindow* getParentWindow () const ;
48
49 // Setters
56 virtual void setLabel (nkMemory::StringView label, bool autoUpdate = true) ;
62 void setAssociatedWin (Window* win) ;
68 void setId (int id) ;
69 } ;
70
71 public :
72
80 TabWindow (System* system) noexcept ;
84 virtual ~TabWindow () ;
85
94 virtual Tab* addTab (nkMemory::StringView label) ;
99 Tab* getTabByLabel (nkMemory::StringView label) const ;
104 Tab* getTabById (int id) const ;
109 Tab* getTabByIndex (unsigned int index) const ;
114 virtual Tab* getTabByMouseRel (nkMaths::Point mouseRel) const = 0 ;
122 int getTabIndex (Tab* tab) const ;
126 unsigned int getTabCount () const ;
136 virtual void reorderTab (Tab* tab, unsigned int newIndex) ;
142 virtual void eraseTab (Tab* tab) ;
143
148 virtual Layout* setLayout (LAYOUT_TYPE layoutType) override ;
149
155 virtual void setActiveTab (Tab* toActivate) ;
159 Tab* getActiveTab () const ;
160
166 virtual void adaptToDisplayArea (Window* toAdapt) const = 0 ;
167
176 void setTabSwitchCallback (std::function<bool (TabWindow*, TabWindow::Tab*, bool)> value) ;
180 const std::function<bool (TabWindow*, TabWindow::Tab*, bool)>& getTabSwitchCallback () const ;
181
182 // Import / Export
183 virtual void exportIntrospection (nkExport::Node* rootNode) override ;
184 virtual void importClassFromTree (nkExport::Node* rootNode) override ;
185
186 public :
187
188 // Statics
196 static nkMemory::UniquePtr<TabWindow> create (System* system = nullptr) ;
197 } ;
198 }
nkWinUi::TabWindow::getTabByLabel
Tab * getTabByLabel(nkMemory::StringView label) const
nkWinUi::TabWindow::setLayout
virtual Layout * setLayout(LAYOUT_TYPE layoutType) override
nkWinUi::LAYOUT_TYPE
LAYOUT_TYPE
Defines the type of layout available.
Definition: LayoutType.h:12
nkWinUi::TabWindow::Tab::setLabel
virtual void setLabel(nkMemory::StringView label, bool autoUpdate=true)
nkWinUi::TabWindow::Tab::setAssociatedWin
void setAssociatedWin(Window *win)
nkWinUi::Layout
Represents a layout to organize children of a component.
Definition: Layout.h:12
nkWinUi::TabWindow::getActiveTab
Tab * getActiveTab() const
nkWinUi::TabWindow::Tab::getLabel
nkMemory::StringView getLabel() const
nkWinUi::TabWindow::Tab::getAssociatedWin
Window * getAssociatedWin() const
nkWinUi::Component
Base class for any graphical component.
Definition: Component.h:12
nkWinUi::TabWindow::setTabSwitchCallback
void setTabSwitchCallback(std::function< bool(TabWindow *, TabWindow::Tab *, bool)> value)
nkWinUi::TabWindow::adaptToDisplayArea
virtual void adaptToDisplayArea(Window *toAdapt) const =0
nkWinUi::System
The main system of the component.
Definition: System.h:18
nkWinUi::TabWindow::eraseTab
virtual void eraseTab(Tab *tab)
nkWinUi::TabWindow::Tab::setId
void setId(int id)
nkWinUi::TabWindow::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkWinUi::TabWindow::reorderTab
virtual void reorderTab(Tab *tab, unsigned int newIndex)
nkWinUi::TabWindow::getTabByMouseRel
virtual Tab * getTabByMouseRel(nkMaths::Point mouseRel) const =0
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkWinUi::TabWindow::~TabWindow
virtual ~TabWindow()
nkMaths::Point
Represents a 2D Point.
Definition: Point.h:12
nkMemory::UniquePtr
Smart pointer owning the object instance it encapsulates.
Definition: UniquePtr.h:17
nkWinUi::TabWindow::addTab
virtual Tab * addTab(nkMemory::StringView label)
nkMemory::StringView
Class holding information about a string, with no ownership over the data.
Definition: StringView.h:22
nkWinUi::TabWindow::Tab
Holds information about a tab in the window.
Definition: TabWindow.h:19
nkWinUi::Window
A graphical window, made for general purpose.
Definition: Window.h:14
nkWinUi::TabWindow::exportIntrospection
virtual void exportIntrospection(nkExport::Node *rootNode) override
nkWinUi::TabWindow::setActiveTab
virtual void setActiveTab(Tab *toActivate)
nkWinUi::TabWindow::getTabCount
unsigned int getTabCount() const
nkWinUi::TabWindow::getTabSwitchCallback
const std::function< bool(TabWindow *, TabWindow::Tab *, bool)> & getTabSwitchCallback() const
nkWinUi::TabWindow::getTabById
Tab * getTabById(int id) const
nkWinUi
Encompasses all API of component NilkinsWinUi.
Definition: Clipboard.h:7
nkWinUi::TabWindow::Tab::getParentWindow
TabWindow * getParentWindow() const
nkWinUi::TabWindow
A graphical tab window.
Definition: TabWindow.h:12
nkWinUi::TabWindow::Tab::getId
int getId() const
nkWinUi::TabWindow::getTabByIndex
Tab * getTabByIndex(unsigned int index) const
nkWinUi::TabWindow::Tab::~Tab
virtual ~Tab()
nkWinUi::TabWindow::create
static nkMemory::UniquePtr< TabWindow > create(System *system=nullptr)
nkWinUi::TabWindow::TabWindow
TabWindow(System *system) noexcept
nkWinUi::TabWindow::getTabIndex
int getTabIndex(Tab *tab) const
nkWinUi::TabWindow::Tab::Tab
Tab(TabWindow *parentWindow) noexcept